package chapter3;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description: 求解线性方程
 * Date:2021/4/1
 * ***************************************************************
 */
public class exc3_3 {
	
	public static void main(String[] args) {
		
		Scanner input=new Scanner(System.in);
		System.out.println("Enter a b c d e f:");
		double a=input.nextDouble();
		double b=input.nextDouble();
		double c=input.nextDouble();
		double d=input.nextDouble();
		double e=input.nextDouble();
		double f=input.nextDouble();
		
		if(a*d-b*c==0) {
			
			System.out.println("The equation has no solution");
			
		}else {
			
			double x=(e*d-b*f)/(a*d-b*c);
			double y=(a*f-e*c)/(a*d-b*c);
			System.out.println("x is "+x+" y is "+y);
			
		}
		
	}

}
